package org.dizem.groupon.action;

import com.opensymphony.xwork2.ActionSupport;
import org.dizem.groupon.model.domain.UserEntity;
import org.dizem.groupon.service.UserService;

import java.util.List;

/**
 * User: dizem@126.com
 * Time: 11-6-27 上午11:06
 * <p/>
 * 取得所有用户列表
 */
public class ListAdminAction extends ActionSupport {

	private List<UserEntity> admins;
	private UserService service;


	public List<UserEntity> getAdmins() {
		return admins;
	}

	public void setAdmins(List<UserEntity> admins) {
		this.admins = admins;
	}

	public UserService getService() {
		return service;
	}

	public void setService(UserService service) {
		this.service = service;
	}

	public String execute() {
		admins = service.loadAllAdmins();
		System.out.println(admins.size());
		return SUCCESS;
	}
}
